home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / WINSYS.PAK / DEFS.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  99 lines

  1. //----------------------------------------------------------------------------
  2. // Borland WinSys Library
  3. // Copyright (c) 1993, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   5.10  $
  6. //
  7. //----------------------------------------------------------------------------
  8. #if !defined(WINSYS_DEFS_H)
  9. #define WINSYS_DEFS_H
  10.  
  11. #if !defined(__cplusplus)
  12. # error Must compile Borland WinSys Library as C++
  13. #endif
  14.  
  15. //----------------------------------------------------------------------------
  16. // We must use all libraries in DLLs if we are using WinSys in a DLL
  17. //
  18. // Define _WSYSDLL with -WSE (-WE for 32bit) to use WSYS & RTL in dlls.
  19. //
  20. // Be sure _BUILDWSYSDLL is defined when building an actual WSYS dll
  21. //
  22. #if defined(_BIDSDLL) || defined(_WSYSDLL) || defined(_SVCSDLL) || defined(_BUILDWSYSDLL) || defined(_RTLDLL)
  23. # if !defined(_WSYSDLL)
  24. #   define _WSYSDLL
  25. # endif
  26. # if !defined(_BIDSDLL)
  27. #   define _BIDSDLL
  28. # endif
  29. # if !defined(_SVCSDLL)
  30. #   define _SVCSDLL
  31. # endif
  32. # if !defined(_RTLDLL)
  33. #   define _RTLDLL
  34. # endif
  35. #endif
  36.  
  37. //
  38. // Get core services definitions and the windowing system headers
  39. //
  40. #if !defined(SERVICES_DEFS_H)
  41. # include <services/defs.h>
  42. #endif
  43.  
  44. //----------------------------------------------------------------------------
  45. // Setup class, function and data modifier macros for WinSys
  46. //
  47.  
  48. #if defined(_BUILDWSYSDLL)
  49. # define _WSYSCLASS     __export _CALLCNVN
  50. # define _WSYSCLASS_RTL __export
  51. # define _WSYSDATA      __export
  52. # define _WSYSFUNC      __export
  53. #elif defined(_WSYSDLL) && !defined(BI_PLAT_OS2)
  54. # define _WSYSCLASS     __import _CALLCNVN
  55. # define _WSYSCLASS_RTL __import
  56. # if defined(BI_PTR_0_32)
  57. #   define _WSYSDATA    __import
  58. #   define _WSYSFUNC    __import
  59. # else
  60. #   define _WSYSDATA    __far
  61. #   define _WSYSFUNC
  62. # endif
  63. #else
  64. # if defined(_WSYSFARVTABLE)
  65. #   define _WSYSCLASS   __huge _CALLCNVN
  66. # else
  67. #   define _WSYSCLASS   _CALLCNVN
  68. # endif
  69. # define _WSYSCLASS_RTL _EXPCLASS
  70. # define _WSYSDATA
  71. # define _WSYSFUNC
  72. #endif
  73.  
  74. //
  75. // The number of entries in an array, available at compile time
  76. //
  77. #define COUNTOF(s)   (sizeof(s) / sizeof((s)[0]))
  78.  
  79. //----------------------------------------------------------------------------
  80. // WinSys extensions to the runtime diagnostics in classlib/checks.h
  81. //
  82. #if defined(BI_NAMESPACE)
  83. namespace ClassLib {
  84. #endif
  85.  
  86. uint8 _WSYSFUNC GetDiagEnabled(char* file, char* name, uint8 e);
  87. uint8 _WSYSFUNC GetDiagLevel(char* file, char* name, uint8 l);
  88.  
  89. #if defined(BI_NAMESPACE)
  90. }     // namespace ClassLib
  91. #endif
  92.  
  93. #define WSYS_INI "OWL.INI"
  94.  
  95. #define DIAG_DEFINE_GROUP_INIT(f,g,e,l)\
  96.   DIAG_DEFINE_GROUP(g, GetDiagEnabled(f,#g,e), GetDiagLevel(f,#g,l));
  97.  
  98. #endif  // WINSYS_DEFS_H
  99.